//# sourceURL=main.js
/**
 * @title main主要方法
 * @description 主要方法入口
 * @author ChenSiTong
 * @date 2018-08-02
 * 主要tab切换 部分弹窗 都在此处
 */
;
var main = main || {};
main = {
    init: function () {

        // menu点击颜色设置
//        $("dd.layui-this").on("click", function () {
//            $(this).find(" a").css({
//                "color": "#fff"
//            })
//        })
//        $("dd.layui-this").on("mouseover", function () {
//            $(this).find("a").css({
//                "color": "#fff"
//            })
//        })
//        $("dd.layui-this").on("mouseout", function () {
//            $(this).find("a").css({
//                "color": "#666"
//            })
//        })

        //顶部nav下拉效果
        $(".layui-nav-item .username").on("mouseover", function () {
            $(this).find("span").css({
                "transform": "rotate(-120deg)"
            })
        })
        $(".layui-nav-item .username").on("mouseout", function () {
            $(this).find("span").css({
                "transform": "rotate(0deg)"
            })
        })
        //右侧列表鼠标移入效果

//        $(".layui-nav-item dd a").on("mouseover", function () {
//            $(this).css({
//                "background": "#1e4a9f",
//                "color": "#fff"
//            })
//        })
//        $(".layui-nav-item dd a").on("mouseout", function () {
//            $(this).css({
//                "background": "none",
//                "color": "#666"
//            })
//        })
//        
        //主体tab切换1
        $(".main-tab-box-1").find(".tab-item").on("click", function () {
            $(this).addClass("on").find(".icon-triangle-1").removeClass("hide");
            $(this).siblings().removeClass("on").find(".icon-triangle-1").addClass("hide")
        })

        //班级管理tab切换
        $(".class-management-box").find(".tab-box-2-item").on("click", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            console.log(index);
            if (index == 0) {
                //隐藏一些div
                $(".divide-style-box,.divide-condition,.divide-condition-2,.main-nav-ps").removeClass("hide");
                $(".divide-statistics-box,.divide-select-box-2,.divide-select-box,.divide-select-query-box").addClass("hide")
            }
            if (index == 1) {
                //隐藏一些div
                $(".divide-style-box,.divide-select-query-box,.divide-select-box-2,.divide-statistics-box,.divide-condition,.divide-condition-2,.main-nav-ps").addClass("hide");
                $(".divide-select-box").removeClass("hide");
            }
            if (index == 2) {
                //隐藏一些div
                $(".divide-style-box,.divide-select-box-2,.divide-select-box,.divide-condition,.divide-statistics-box,.divide-condition-2,.main-nav-ps,.divide-select-box").addClass("hide");
                $(".divide-select-query-box").removeClass("hide")
            }
            if (index == 3) {
                //隐藏一些div
                $(".divide-style-box,.divide-select-query-box,.divide-condition,.divide-condition-2,.main-nav-ps,.divide-select-box").addClass("hide");
                $(".divide-select-box-2,.divide-statistics-box").removeClass("hide");
            }
            $(".class-table").addClass("hide");
            $(".class-table-" + index).removeClass("hide");
        })

        //学籍管理tab切换
        $(".main-tab-school-status").find(".tab-box-2-item").on("click", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".c-table-school-status-1,.c-tab-school-status-setting").removeClass("hide");
                $(".c-tab-school-status-btn,.c-table-school-status-2,.c-table-school-status-3,.c-tab-school-status-btn-2").addClass("hide")
            } else if (index == 1) {
                $(".c-table-school-status-1,.c-tab-school-status-setting,.c-table-school-status-3,.c-tab-school-status-btn-2").addClass("hide");
                $(".c-tab-school-status-btn,.c-table-school-status-2").removeClass("hide");
            } else {
                $(".c-tab-school-status-setting,.c-table-school-status-2,.c-table-school-status-1,.c-tab-school-status-btn").addClass("hide")
                $(".c-table-school-status-3,.c-tab-school-status-btn-2").removeClass("hide")
            }
        })

        //社团管理切换
        $(".main-tab-association").find(".tab-box-2-item").on("click", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".c-table-association-1").removeClass("hide");
                $(".c-table-association-2,.c-table-association-3").addClass("hide");
            } else if (index == 1) {
                $(".c-table-association-1,.c-table-association-3").addClass("hide");
                $(".c-table-association-2").removeClass("hide");
            } else {
                $(".c-table-association-1,.c-table-association-2").addClass("hide");
                $(".c-table-association-3").removeClass("hide");
            }
        })


        //班级管理图标表格切换
        $(".divide-select-box-2").on("click", "button", function () {
            var this_text = $.trim($(this).find(".text").text());
            console.log(this_text)
            if (this_text == "切换图表") {
                $(this).find(".text").text("切换表格");
                $(".class-table-3").addClass("hide");
                $("#man_woman_line").removeClass("hide")
            } else {
                $(this).find(".text").text("切换图表");
                $(".class-table-3").removeClass("hide");
                $("#man_woman_line").addClass("hide");
            }
        })

        //分班统计下方的tab切换
        $(".divide-statistics-box").on("click", ".tab-item", function () {
            var index = $(this).index();
            if (index == 0) {
                $(".class-table-3").removeClass("hide");
                $("#man_woman_line,.class-table-4,.class-table-5,.button-setting-score-section").addClass("hide");
                $(".divide-select-box-2").find("button .text").text("切换图表");
            } else if (index == 1) {
                $(".class-table-4").removeClass("hide");
                $("#man_woman_line,.class-table-3,.class-table-5,.button-setting-score-section").addClass("hide");
                $(".divide-select-box-2").find("button .text").text("切换图表");
            } else {
                $(".divide-statistics-box .button-setting-score-section").removeClass("hide")
                $(".class-table-5").removeClass("hide");
                $("#man_woman_line,.class-table-3,.class-table-4").addClass("hide");
                $(".divide-select-box-2").find("button .text").text("切换图表");
            }
        })

        //组织管理tab切换
        $(".main-tab-organization").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".c-table-organization-1").removeClass("hide");
                $(".c-table-organization-2,.c-table-organization-3,.tab-organization-notice,.tab-league-member").addClass("hide");
            } else if (index == 1) {
                $(".c-table-organization-1,.c-table-organization-3,.tab-organization-notice").addClass("hide")
                $(".c-table-organization-2,.tab-league-member").removeClass("hide")
            } else {
                $(".c-table-organization-1,.c-table-organization-2,.tab-league-member").addClass("hide");
                $(".c-table-organization-3,.tab-organization-notice").removeClass("hide");
            }
        })

        //评价管理 tab切换
        $(".main-tab-appraise-management").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-appraise-nav,.c-table-organization-2,.c-table-organization-3,.main-tab-appraise-btn").addClass("hide")
                $(".c-table-organization-1").removeClass("hide")
            } else if (index == 1) {
                $(".tab-box-appraise-nav,.c-table-organization-2").removeClass("hide")
                $(".c-table-organization-1,.c-table-organization-3,.main-tab-appraise-btn").addClass("hide");
            } else {
                $(".tab-box-appraise-nav,.c-table-organization-2,.c-table-organization-3,.main-tab-appraise-btn").removeClass("hide");
                $(".c-table-organization-1,.c-table-organization-2,.tab-box-appraise-nav").addClass("hide");
            }
        })
        //奖罚切换
        $(".main-tab-reward-punishment").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".c-table-reward-punishment-1,.tab-box-reward-nav-1").removeClass("hide");
                $(".tab-box-reward-nav-2,.c-table-reward-punishment-3,.tab-box-reward-nav-3,.c-table-reward-punishment-2").addClass("hide")
            } else if (index == 1) {
                $(".c-table-reward-punishment-1,.tab-box-reward-nav-1,.c-table-reward-punishment-3,.tab-box-reward-nav-3").addClass("hide");
                $(".tab-box-reward-nav-2,.c-table-reward-punishment-2").removeClass("hide")
            } else {
                $(".c-table-reward-punishment-1,.tab-box-reward-nav-1,.c-table-reward-punishment-2,.tab-box-reward-nav-2").addClass("hide");
                $(".tab-box-reward-nav-3,.c-table-reward-punishment-3").removeClass("hide");
            }
        })

        //资助管理切换-top-1 main
        $(".main-tab-support-management-main").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".main-tab-support-management").removeClass("hide");
                $(".main-tab-support-management-3,.main-tab-support-management-2,.tab-box-support-management-nav-2,.tab-box-support-management-nav-1,.tab-box-support-management-nav-3").addClass("hide");
                $(".tab-box-support-management-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-1").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".main-tab-support-management-3,.main-tab-support-management,.tab-box-support-management-nav-2,.tab-box-support-management-nav-1,.tab-box-support-management-nav-3").addClass("hide");
                $(".main-tab-support-management-2,.tab-box-support-management-nav-2-1").removeClass("hide");
                $(".tab-box-support-management-nav-2-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-4").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".main-tab-support-management,.main-tab-support-management-2").addClass("hide")
                $(".main-tab-support-management-3").removeClass("hide");
                $(".tab-box-support-management-nav-3-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-1").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        //
        $(".main-tab-support-management-2").on("click", ".tab-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-support-management-nav-2-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-4").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-support-management-nav-2-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-5").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".tab-box-support-management-nav-2-3").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-6").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        //资助管理切换-2
        $(".main-tab-support-management").on("click", ".tab-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-support-management-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-1").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-support-management-nav-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-2").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".tab-box-support-management-nav-3").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        //勤工岗位管理tab
        $(".main-tab-support-management-3").on("click", ".tab-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-support-management-nav-3-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-1").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-support-management-nav-3-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-2").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 2) {
                $(".tab-box-support-management-nav-3-3").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-3").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 3) {
                $(".tab-box-support-management-nav-3-4").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-4").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".tab-box-support-management-nav-3-5").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-support-management-3-5").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        //活动管理tab
        $(".main-tab-activity-management").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-activity-m-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-activity-management-1").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-activity-m-nav-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-activity-management-2").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 2) {
                $(".tab-box-activity-m-nav-3").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-activity-management-3").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 3) {
                $(".tab-box-activity-m-nav-4").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-activity-management-4").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".tab-box-activity-m-nav-5").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".c-table-activity-management-5").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })


        //数据分析 年龄分析tab
        $(".main-tab-age-proportion").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-data-analysis-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-age-line").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-data-analysis-nav-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-age-pie").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        // 学生人数分析
        $(".main-tab-student-count").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-data-analysis-sc-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-age-line").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-data-analysis-sc-nav-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-age-pie").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })

        // 毕业分析
        $(".main-tab-graduation").on("click", ".tab-box-2-item", function () {
            $(this).addClass("on").siblings().removeClass("on");
            var index = $(this).index();
            if (index == 0) {
                $(".tab-box-data-analysis-g-nav-1").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-bar").removeClass("hide").siblings(".main-box").addClass("hide");
            } else if (index == 1) {
                $(".tab-box-data-analysis-g-nav-2").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-pie-1").removeClass("hide").siblings(".main-box").addClass("hide");
            } else {
                $(".tab-box-data-analysis-g-nav-3").removeClass("hide").siblings(".main-tab-box-3").addClass("hide");
                $(".main-box.c-chart-pie-2").removeClass("hide").siblings(".main-box").addClass("hide");
            }
        })



        //弹窗
        //

        //毕业生管理 批量导入
        $(".tab-box-graduate-m").on("click", ".btn-batch-into", function () {
            $.get_layer({
                title: "岗位发布",
                type: "1",
                html: $("#batch_into_layer").html(),
                btn_arr: ["取消", "确认"],
                area: ['600px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })




        //发布活动
        $(".tab-box-activity-m-nav-1").on("click", ".grant-activity-btn", function () {
            $.get_layer({
                title: "岗位发布",
                type: "1",
                html: $("#activity_grant_layer").html(),
                btn_arr: ["取消", "保存"],
                area: ['780px', '600px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
            $(".rich-text-box").css({
                "width": "77.2%",
                "margin-left": "123px"
            }).append(
                    `<script id="container" name="content" type="text/plain">
                </script>`
                    )
            UE.delEditor('container');
            var ue = UE.getEditor('container');
        })


        //岗位发布
        $(".btn-release-post").on("click", function () {
            $.get_layer({
                title: "岗位发布",
                type: "1",
                html: $("#release_post_layer").html(),
                btn_arr: ["取消", "保存"],
                area: ['780px', '500px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })

        //个人可申请岗位数
        $(".btn-personal-can-apply").on("click", function () {
            $.get_layer({
                title: "个人可申请岗位数",
                type: "1",
                html: $("#personal_can_apply").html(),
                btn_arr: ["取消", "确定"],
                area: ['488px', 'auto'],
                btn1: function () {


                },
                btn2: function () {
//                    layer.open();
                    var geshu = $("[name=geshu]").val();
                    layer.msg("设置成功", {time: 1500});
                    window.location.href = "/admin/Diligent/gangweishu?geshu="+geshu;
//                    if(geshu=="")
//                    {
//                        $("[name=geshu]").focus();
//                        return false;
//                    }

                }
            })
        })

        //
        //增加奖学金list
        $(".tab-box-support-management-nav-2-1").on("click", ".add-btn-scholarship", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: $("#add_scholarship_apply").html(),
                btn_arr: ["取消", "保存"],
                area: ['800px', '600px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
            $(".add_scholarship_apply .rich-text-box").append(`<script id="scholarship_apply_rich_text" class='hide' name="content" type="text/plain">
            这里写你的初始化内容
        </script>`);

        })


        $(".tab-item-r-reward-apply").on("click", ".add-reward-apply", function () {
            $.get_layer({
                title: "新增申请",
                type: "1",
                html: $("#add_reward_apply_layer").html(),
                btn_arr: ["取消", "保存"],
                area: ['500px', '450px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
            //点击查询后 显示信息
            $(".add-reward-apply-layer").on("click", ".btn-check", function () {
                $(".check-content-box").removeClass("hide")
            })
        })

        //健康管理-新增 
        $(".main-tab-health-btn").on("click", ".add-health-btn", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: $("#health_table_add_layer").html(),
                btn_arr: ["取消", "确定"],
                area: ['1200px', '600px'],
                btn1: function () {

                },
                btn2: function () {

                    alert(1);

                }
            })
            layui.use('laydate', function () {
                var laydate = layui.laydate;

                //执行一个laydate实例
                laydate.render({
                    elem: '#date_of_diagnosis' //指定元素
                });
                //执行一个laydate实例
                laydate.render({
                    elem: '#operation_time' //指定元素
                });
            });
        })

        //添加评价
        $(".main-tab-appraise-btn").on("click", ".add-appraise-btn", function () {
            $.get_layer({
                title: "添加评论",
                type: "1",
                html: $("#add_appraise_layer").html(),
                btn_arr: ["取消", "确定"],
                area: ['480px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                    var name = $("#name").val();
                    alert(name);
                    if (name == "")
                    {
                        return false;
                    } else
                    {
                        $.post("{:url('Evaluation/addevaluation')}", {name: name}, function (data) {

                            if (data == 1)
                            {
                                top.layer.open({
                                    shadeClose: true,
                                    title: '提示',
                                    content: '添加完成',
                                    icon: 1,
                                    time: 2 * 1000,
                                    end: function () {
                                        window.location.reload();

                                    }
                                });

                            } else {

                            }

                        })
                    }


                }
            })
        })

        //删除评价
        //    $(".main-tab-appraise-btn").on("click",".delete-appraise-btn",function(){
        //         $.get_layer({
        //             title: "添加评论",
        //             type:"1",
        //             html:$("#remove_appraise_layer").html(),
        //             btn_arr:["取消","确定"],
        //             area:['480px', 'auto'],
        //             btn1:function(){

        //             },
        //             btn2:function(){

        //             }
        //         })
        //    })


        //组织公告-增加
        $(".btn-add-organization-notice").on("click", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: $("#add_organization_notice_layer").html(),
                btn_arr: ["取消", "保存"],
                area: ['558px', '580px'],
                btn1: function () {

                },
                btn2: function () {

                    $("#addzzgg").submit();

                }
            })
        })

        //党员table - 删除
        $(".delete-party-member").on("click", function () {
            var hasCheck = $(".c-table-organization-party-member").find("tbody tr td.checkbox input:checked");
            if (hasCheck.length == 0 || hasCheck.length > 1) {
                layer.msg("必须选择且只能选择一行进行操作");
            } else {
                $.get_layer({
                    title: "提示",
                    type: "1",
                    html: $("#delete_party_member_layer").html(),
                    btn_arr: ["取消", "确认"],
                    area: ['486px', '160px'],
                    btn1: function () {

                    },
                    btn2: function () {

                    }
                })
            }

        })




        //缴费管理-增加
        $(".add-pay-management").on("click", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: $("#add_pay_management_layer").html(),
                btn_arr: ["重置", "保存"],
                area: ['737px', '400px'],
                btn1: function () {

                },
                btn2: function () {

                    $("#jf").submit();

                }
            })
        })

        //一键升级-提示
        $(".oneKey-upgrade").on("click", function () {
            $.get_layer({
                title: "提示",
                type: "1",
                html: $("#upgrade_tips").html(),
                btn_arr: [],
                area: ['630px', '230px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })

        //学籍异动-查看详情弹窗
        $(".c-table-school-status-unusual-action-2").on("click", ".oparation-td", function () {
            $.get_layer({
                title: "查看详情",
                type: "1",
                html: $("#school_status_view_details_has_examined").html(),
                btn_arr: ["取消", "确认"],
                area: ['1070px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
            layui.use('laydate', function () {
                var laydate = layui.laydate;

                //执行一个laydate实例
                laydate.render({
                    elem: '#unusual_action_date' //指定元素
                });
            });
        })

        //学籍异动-增加
        $(".add-school-status-unusual-action-info").on("click", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: $("#add_school_status_unusual_action").html(),
                btn_arr: [],
                area: ['1010px', '500px'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
            var data_table = {
                head: ["学号", "班级", "姓名", "性别", "民族", "身份证号", "入学年份"],
                data: [
                    {
                        d1: ["103003121", "高一（1）班", "小茗同学", "男", "汉", "340101199909091234", "2018"]
                    },
                    {
                        d1: ["103003121", "高一（1）班", "小茗同学", "男", "汉", "340101199909091234", "2018"]
                    },
                    {
                        d1: ["103003121", "高一（1）班", "小茗同学", "男", "汉", "340101199909091234", "2018"]
                    },
                    {
                        d1: ["103003121", "高一（1）班", "小茗同学", "男", "汉", "340101199909091234", "2018"]
                    }
                ]
            }
            $.getTable({
                dom: ".c-table-school-status-unusual-action-layer",
                data: data_table,
                hasCheckbox: true
            })
        })


        //设置分数段弹窗
        $(".divide-statistics-box").on("click", ".button-setting-score-section", function () {
            $.get_layer({
                title: "设置分数段",
                type: "1",
                html: $("#settingScoreSection_layer").html(),
                btn_arr: ["取消", "确认"],
                area: ['373px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })



        //添加学籍信息弹窗
        $(".add-school-status").on("click", function () {
            $.get_layer({
                title: "手动添加",
                type: "1",
                html: $("#add_school_status_layer").html(),
                btn_arr: ["取消", "保存"],
                area: ['1070px', '500px'],
                btn1: function () {

                },
                btn2: function () {
                    $("#xuejitanchuan").submit();
                    //alert(1);
                    //$("[name=tj]").click();
//                     var filepath=getPath(document.getElementById("iptfileupload"));
//                    alert(filepath);
//                 


                }
            })
        })

        //分班优化按钮
        $(".optimization-btn").on("click", function () {
            $.get_layer({
                title: "优化",
                type: "1",
                html: $("#optimization_layer").html(),
                btn_arr: ["取消", "开始优化"],
                area: ['550px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })
        var layer_html = `<div class='main-layer-box'>
                            <span class=''>名称：</span>
                            <input type='text' placeholder='请输入名称'>
                        </div>`
        $(".tab-item-right").find(".add-btn").on("click", function () {
            $.get_layer({
                title: "新增",
                type: "1",
                html: layer_html,
                btn_arr: ["取消", "提交"],
                area: ['484px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })

        //增加权限
        var layer_add_permission = $(".add-permission-box").html();
        $("#updaterole").on("click", function () {
            console.log(1111)
            $.get_layer({
                title: "权限配置",
                type: "1",
                html: $("#permission_config").html(),
                btn_arr: ["取消", "保存"],
                area: ['840px', 'auto'],
                btn1: function () {

                },
                btn2: function () {

                }
            })
        })


        //手动增加用户
        var layer_manual_add_user = $(".manual-add-user").html();
        $(".manual-add").on("click", function () {
            $.get_layer({
                title: "手动添加",
                type: "1",
                html: layer_manual_add_user,
                area: ['400px', '450px'],
                btn_arr: ["取消", "确定"],
                btn1: function () {

//                    alert(1);

                },
                btn2: function () {
                    $("[name=addform]").submit();
                }
            })
            layui.use('laydate', function () {
                var laydate = layui.laydate;
                console.log(laydate)
                //执行一个laydate实例
                laydate.render({
                    elem: '#manual_date' //指定元素
                });
            });
        })
        //调班
        $(".c-table-class-divide-query").on("click", ".oparation-td span", function () {
            $.get_layer({
                title: "调班",
                type: "1",
                html: $("#dispatchClass_layer").html(),
                btn_arr: ["下一步"],
                area: ['484px', 'auto'],
                btn1: function () {
                    console.log(1);
                    $.get_layer({
                        title: "调班",
                        type: "1",
                        html: $("#dispatchClass_2_layer").html(),
                        btn_arr: ["上一步", "确定"],
                        area: ['484px', 'auto'],
                        btn1: function () {

                        },
                        btn2: function () {
                            $.get_layer({
                                title: "调班",
                                type: "1",
                                html: $("#dispatchClass_3_layer").html(),
                                btn_arr: ["上一步", "确定"],
                                area: ['484px', 'auto'],
                                btn1: function () {

                                },
                                btn2: function () {

                                }
                            })
                        }
                    })
                }
            })
            $(".dispatchClass_layer").parent().parent().find(".layui-layer-btn a").css({
                "background": "#2a52b1",
                "color": "#fff"
            })
        })
        //执行一个laydate实例


    },
    //小屏幕table处理
    smallScreen: function () {
        $(".layui-header").on("click", ".icon-menu", function () {
            console.log(1);
            if ($(".layui-side").css("width") == "240px") {
                $(".layui-side").css({
                    "width": "0px"
                })
            } else {
                $(".layui-side").css({
                    "width": "240px"
                })
            }

        })
        $(window).resize(function () {          //当浏览器大小变化时
            if (parseInt($(this).width()) > 600) {
                $(".layui-side").css({
                    "width": "240px"
                })
            } else {
                $(".layui-side").css({
                    "width": "0px"
                })
            }
        });
    }

}
main.init();
main.smallScreen();